<template>
    <mescroll-uni ref="mescrollRef" @init="mescrollInit" :height="height" :down="downOption" @down="downRefresh"
        :up="upOption" @up="getData">
        <member-item v-for="(item, index) in datas" :item="item" :index="index" :key="index"></member-item>
        <view class="list-footer"></view>
    </mescroll-uni>
</template>

<script>
import memberItem from "./member-item.vue"
import { GetWholeSaleMoneyList, GetInvitUserByPage, GetInvitUserByList } from "@/service/api/member.js"
import { GetInvitUserOrderList } from "@/service/api/order.js"
export default {
    components: {
        memberItem
    },
    props: {
        height: {
            type: String,
            default: "300px",
        },
    },
    data() {
        return {
            datas: [],
            allLength: 0,
            productList: [],
            param: {
                valetType: -1,
                payState: -1,
            },
            downOption: {
                use: true,
            },
            isLoaded: false,
        }
    },
    mounted() {
        this.refresh()
    },
    methods: {
        //获取列表数据
        getData(page) {
            // let param = this.requestData
            let param = {}
            param.pageSize = page.size
            param.pageIndex = page.num
            GetInvitUserByList(param).then((res) => {
                this.total = res.RecordAmout
                this.mescroll.endBySize(res.Data.length, res.RecordAmout)
                this.datas = this.datas.concat(res.Data)
            })
        },
        //刷新
        refresh(param) {
            if (param) {
                this.param = param
            }
            this.downRefresh()
        },
        //刷新
        downRefresh() {
            this.datas = []
            this.mescroll.resetUpScroll()
        },
    },
}
</script>

<style lang="scss">
.list-footer {
    height: 60rpx;
}
</style>
